package org.thought;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class ThoughtFoodActivity extends Activity implements OnClickListener {
	Button dailyPrayer;
	Button randomPrayer;
	Button dailySay;
	Button randomSay;
	
	final int PRAYER = 1000;
	final int SAYING = 1001;
	final int DAILY = 2000;
	final int RANDOM = 2001;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        dailyPrayer = (Button)findViewById(R.id.dailyPrayer);
        randomPrayer = (Button)findViewById(R.id.randomPrayer);
        dailySay = (Button)findViewById(R.id.dailySay);
        randomSay = (Button)findViewById(R.id.randomSay);
        
        dailyPrayer.setOnClickListener(this);
        randomPrayer.setOnClickListener(this);
        dailySay.setOnClickListener(this);
        randomSay.setOnClickListener(this);
    }

    /**
     * Without doubt, one of the buttons was clicked. Therefore an intent will
     * be creater accordingly. 
     */
	@Override
	public void onClick(View clicked) {
		Intent intent;
		
		intent = new Intent();
		
		if(clicked == dailyPrayer){
			intent.setClass(this, Display.class);
			intent.putExtra("text", PRAYER);
		}
		if(clicked == randomPrayer){
			intent.setClass(this, Random.class);
			intent.putExtra("text", PRAYER);
		}
		if(clicked == dailySay){
			intent.setClass(this, Display.class);
			intent.putExtra("text", SAYING);
		}
		if(clicked == randomSay){
			intent.setClass(this, Random.class);
			intent.putExtra("text", SAYING);
		}
		
		startActivity(intent);
	}
}